refs: add "ostree refs --create" and unit tests
authorYu Qi Zhang <jzehrarnyg@gmail.com>
Tue, 14 Jun 2016 14:13:06 +0000 (14:13 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 15 Jun 2016 20:42:30 +0000 (20:42 +0000)
commitf8fcdba0a542507917fe49a7b81b8932c6ce115e
tree00afc5a30ca80d62c89ca23353d26f50e303f4e5
parent7847bc7394c5de82f7993c7ab1f6ffc1719683c8
refs: add "ostree refs --create" and unit tests

Added the ability to create a ref (much like a git tag) for an
existing commit through "ostree refs EXISTING --create=NEWREF".
Previously the only way to create a new ref was by creating a new commit,
but refs --create allows multiple refs to point to the same commit.

The command will fail if:
 - None/more than one existing ref is specified
 - The specified EXISTING tag does not exist, or was not specified
 - The specified NEWREF already exists, or is the name of a folder

Add unit tests in tests-ref.sh to verify above functionality

Closes: #340
Approved by: jlebon
src/ostree/ot-builtin-refs.c
tests/test-refs.sh